<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	template="../templates/user_template.xhtml">

	<ui:define name="css-styles">
		<h:outputStylesheet library="css" name="user-tickets-style.css" />
	</ui:define>

	<ui:define name="title">
			Резервации
	</ui:define>

	<ui:define name="content">

		<h:form>
			<p>
				<h:outputLabel value="Username на потребителя: "
					style="color: black;" />
				<h:inputText value="#{staffTicketsList.username}" />
				<h:commandButton value="Търсене" />
			</p>
		</h:form>

		<h:outputText id="header-staff-tickets-username"
			rendered="#{! empty staffTicketsList.username and !staffTicketsList.isValidUsername()}">
			<h1 align="center">Не е намерено потребителското име:
				#{staffTicketsList.username}</h1>
		</h:outputText>

		<h:outputText id="header-staff-tickets-list"
			rendered="#{! empty staffTicketsList.username and !staffTicketsList.isValidReservation()}">
			<h1 align="center">Няма направени регистрации от
				#{staffTicketsList.username}</h1>
		</h:outputText>

		<h:dataTable value="#{staffTicketsList.staffTickets}" var="item"
			styleClass="order-table" headerClass="order-table-header"
			rowClasses="order-table-odd-row,order-table-even-row" border="1"
			rendered="#{! empty staffTicketsList.username and staffTicketsList.isValidReservation() and staffTicketsList.isValidUsername()}">

			<h:column>
				<f:facet name="header">
					Номер
				</f:facet>
				#{item.number}			
		</h:column>

			<h:column>
				<f:facet name="header">
					Име на филма
				</f:facet>
				#{item.reserved_name}			
		</h:column>

			<h:column>
				<f:facet name="header">
					Жанр
				</f:facet>
				#{item.reserved_movie_type}
		</h:column>

			<h:column>
				<f:facet name="header">
					Продължителност
				</f:facet>
				#{item.reserved_duration}			
		</h:column>

			<h:column>
				<f:facet name="header">
					Номер на зала
				</f:facet>
				#{item.reserved_number_hall}
		</h:column>

			<h:column>
				<f:facet name="header">
					Номер на място
				</f:facet>
				#{item.reserved_seat_number}			
		</h:column>

			<h:column>
				<f:facet name="header">
					Цена на билет
				</f:facet>
				#{item.reserved_ticket_price}	
		</h:column>

			<h:column>
				<f:facet name="header">
					Изтичане на резервацията
				</f:facet>
				#{item.reserved_expires_at}
		</h:column>

			<h:column>
				<f:facet name="header">
					Начало на прожекцията
				</f:facet>
				#{item.reserved_projection_start}		
		</h:column>

			<h:column>
				<f:facet name="header">
					Статус
				</f:facet>
				#{item.reserved_ticket_status}		
		</h:column>

		</h:dataTable>

	</ui:define>
</ui:composition>